/**
 * 
 */
package tau.adx.common.messages.auction;

import lombok.Data;
import lombok.EqualsAndHashCode;
import tau.adx.common.adn.AdNetwork;
import tau.adx.common.bids.BidInfo;
import tau.adx.common.bids.bundles.AdxBidBundle;
import tau.adx.common.publishers.AdxPublisher;
import tau.adx.common.users.AdxUser;

/**
 * Indicates that an auction in the system was won. Contains data about: <li>
 * {@link AdxBidBundle winning bundle}</li><li>{@link BidInfo winning bid}</li>
 * <li>{@link AdxUser user} the auction was performed for</li><li>
 * {@link AdxPublisher publisher} the auction was performed for</li><li>
 * <b>Reserve Price</b> sent by the {@link AdxPublisher publisher}</li>
 * 
 * @author greenwald
 * 
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class AuctionWon extends AuctionMessage {

	/**
	 * The actual price to be payed.
	 */
	private double actualPrice;

	/**
	 * Winning {@link AdNetwork}.
	 */
	private AdNetwork adNetwork;
	/**
	 * Winning {@link BidInfo bid} info.
	 */
	private BidInfo bidInfo;

	/**
	 * @param user
	 *            {@link AdxUser} auction was performed for.
	 * @param publisher
	 *            {@link AdxPublisher} auction was performed for.
	 * @param reservePrice
	 *            {@link AdxPublisher Publisher}'s reserve price.
	 * @param adNetwork
	 *            Winning {@link AdNetwork}.
	 * @param bidInfo
	 *            Winning {@link BidInfo bid} info.
	 * @param actualPrice
	 *            The actual price to be payed.
	 */
	public AuctionWon(AdxUser user, AdxPublisher publisher,
			double reservePrice, AdNetwork adNetwork, BidInfo bidInfo,
			double actualPrice) {
		super(user, publisher, reservePrice);
		this.adNetwork = adNetwork;
		this.bidInfo = bidInfo;
		this.actualPrice = actualPrice;
	}

}
